import network from '@/common/network.js'

//微信公众号
export const getSignature = data =>network({
  url: '/gp-boot/gp/api/wxpay/signature',
  method: 'get',
  data,
  auth: true,
})
//新闻点赞操作
export const setAddUserNewsOperateTimes = data => network({
    url:`/gp-boot/gp/api/gpUserNewsOperateTimes/addUserNewsOperateTimes?category=${data.category}&newsId=${data.newsId}`,
    data,
  method:'post',
    auth: true,
})

//新闻-分页列表查询
export const gpNewsList = param =>{
  return network({
    url: '/gp-boot/gp/api/gpNews/list',
    param
  })
}
//新闻视图-分页列表查询
export const gpVNewsList = param =>{
  return network({
    url: '/gp-boot/gp/api/gpNews/vlist',
    param
  })
}
//场景信息-分页列表查询
export const gpSceneList = param=> {
  return network({
    url: '/gp-boot/gp/api/gpScene/list',
    param,
    auth: true,
  })
}

//群团免登
export const getGroupUrl = id=> {
  return network({
    url: `/gp-boot/gp/login/getGroupUrl/g${id}`,
    method: 'get',
    auth: true,
  })
}
// 用户访问量-添加
export const postDayVisits =  (userFrom, flag)=> {
  const url = '/gp-boot/gp/api/gpVisits/visit/' + userFrom + '?flag=' + flag
  return network({
    url: url,
    data: {},
    method: 'post',
  })
}
//用户访问量-添加访问量
export const postDayVisitsUrl = (url, title)=> {
  const _url = '/gp-boot/gp/api/gpVisits/visitUrl?url=' + url + '&title=' + title

  return network({
    url: _url,
    data: {},
    method: 'post',
  })
}

//投票管理-分页列表查询
export const getvoteList = param=> {
  return network({
    url: '/gp-boot/gp/api/gpVote/list',
    param,
    auth: true,
  })
}
//添加新闻日访问量-添加访问量
export const gpVisitNewsPv = param => network({
  url:'/gp-boot/gp/api/gpVisits/visitNewsPv',
  param,
  method: 'post'
})
